package com.czh.subject.domain.convert;

import com.czh.subject.domain.entity.SubjectAnswerAndOptionBO;
import com.czh.subject.domain.entity.SubjectInfoBO;
import com.czh.subject.infra.basic.entity.SubjectInfo;
import com.czh.subject.infra.basic.entity.SubjectInfoES;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface SubjectInfoConverter {

    SubjectInfoConverter INSTANCE = Mappers.getMapper(SubjectInfoConverter.class);

    SubjectInfo convert(SubjectInfoBO subjectInfoBO);

    List<SubjectInfoBO> convert(List<SubjectInfo> subjectInfoList);

    SubjectInfoBO convert(SubjectInfo subjectInfo, SubjectAnswerAndOptionBO optionAndAnswer);

    @Mapping(source = "subjectId", target = "id")
    SubjectInfoBO convert(SubjectInfoES subjectInfoES);
}
